<template>
  <div class="my">
    <component :is="havingLogin ? 'user' : 'login'"></component>
    <van-tabbar v-model="active_tab" route>
      <van-tabbar-item icon="home-o" to="/">Home</van-tabbar-item>
      <van-tabbar-item icon="contact" to="/my">My</van-tabbar-item>
    </van-tabbar>
  </div>
</template>

<script>
import login from "@/components/login.vue";
import user from "@/components/user.vue";
import { mapState } from "vuex";
export default {
  name: "My",
  components: {
    login,
    user,
  },
  data() {
    return {
      // havingLogin: false, // 用户是否已经登录
      active_tab: 1,
    };
  },
  methods: {},
  computed: {
    ...mapState("m_user", ["havingLogin"]),
    // ...mapState("m_tab", ["active_tab"]),
  },
};
</script>

<style lang="scss">
.my {
  height: calc(100vh - 50px);
}
</style>
